package com.qf.java2102.qihaonan.hotel.service.impl;

import com.qf.java2102.qihaonan.hotel.dao.IFoodTypeDao;
import com.qf.java2102.qihaonan.hotel.dao.impl.FoodTypeDaoImpl;
import com.qf.java2102.qihaonan.hotel.pojo.FoodType;
import com.qf.java2102.qihaonan.hotel.service.IFoodTypeService;
import com.qf.java2102.qihaonan.hotel.utils.JdbcUtils;

import java.sql.SQLException;
import java.util.List;

/**
 * @author qhn
 * @version 1.0
 */
public class FoodTypeServiceImpl implements IFoodTypeService {

    private IFoodTypeDao foodTypeDao = new FoodTypeDaoImpl();

    @Override
    public List<FoodType> findAll() {
        try {
            return foodTypeDao.findAll();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            JdbcUtils.release(JdbcUtils.getConnection());
        }
        return null;
    }
}
